package com.giaothong;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

import com.giaothong.view.BienBaoListAdapter;

public class ShowListBienBaoActivity extends Activity {

	private ListView listViewBienBao;
	private BienBaoListAdapter bBaoListAdapter;
	Context context;
	private Button btnSetting;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.screen_hienthibienbao_listview);
		context = this;
		viewUnit();
		
		bBaoListAdapter = new BienBaoListAdapter(context, TabLyThuyetActivity.bBaoList);
		listViewBienBao.setAdapter(bBaoListAdapter);
		
		listViewBienBao.setOnItemClickListener(new OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int position,
					long id) {
				// TODO Auto-generated method stub
				Log.i("position = ",position +"");
				Log.i("id = ",id +"");
				
			}
		}); 
		
		btnSetting.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(context, ShowGridBienBaoActivity.class);
				onPause();
				startActivityForResult(intent, 0);
			}
		});
		
	}
	private void viewUnit(){
		listViewBienBao = (ListView) findViewById(R.id.list_bienbao);
		btnSetting = (Button)findViewById(R.id.hienBienBao_btn_setting);
	}
	
		

	
}